package atm05;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * 转账界面
 */
public class TransferPanel extends JPanel{
    private JLabel user = new JLabel("输入转账用户名：");
    private JLabel blance = new JLabel("输入转账金额：");
    private JTextField userText = new JTextField();
    private JTextField blanceText = new JTextField();
    private JButton sureBtn = new JButton(new ImageIcon("src/atm05/Images/buttonSure.jpg"));
    private JButton exitBtn = new JButton(new ImageIcon("src/atm05/Images/buttonOff.jpg"));
    private Font font = new Font("黑体",Font.BOLD,25);

    public TransferPanel(ATM05 atm05) {
        this.setLayout(null);

        user.setBounds(300,200,220,50);
        user.setFont(font);

        blance.setBounds(300,300,220,50);
        blance.setFont(font);

        userText.setBounds(530,200,220,50);
        userText.setFont(font);

        blanceText.setBounds(530,300,220,50);
        blanceText.setFont(font);

        sureBtn.setBounds(420,420,140,50);

        exitBtn.setBounds(880,380,140,50);
        exitBtn.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                atm05.showPanel("menu");
            }
        });


        this.add(user);
        this.add(blance);
        this.add(userText);
        this.add(blanceText);
        this.add(sureBtn);
        this.add(exitBtn);

        this.setOpaque(false);
    }
}
